#include <iostream>
using namespace std;

class Prototype
{
public:
	virtual ~Prototype()
	{
	}
	virtual Prototype* Clone() const = 0
	{
		return 0;
	}
protected:
	Prototype()
	{
	}
public:
	int val;
};
class ConcretePrototype:public Prototype
{
public:
	ConcretePrototype()
	{
	}
	ConcretePrototype(const	ConcretePrototype& cp)
	{
		cout<<"ConcretePrototype copy ..."<<endl;
		cout<<val<<endl;
	}
	~ConcretePrototype()
	{
	}
	Prototype* Clone() const
	{
		return new ConcretePrototype(*this);
	}
};

int main(int argc,char* argv[])
{
	Prototype* p = new ConcretePrototype();
	p->val = 3;
	Prototype* p1 = p->Clone();
	return 0;
}